package com.ug_project.spring_dict

import com.ug_project.spring_dict.Controllers.accountModule
import com.ug_project.spring_dict.DataAccess.Migrations.*
import com.ug_project.spring_dict.DataAccess.Migrations.DictTables.*
import com.ug_project.spring_dict.DataAccess.connectDb
import io.ktor.locations.Location
import io.ktor.server.engine.embeddedServer
import io.ktor.server.netty.Netty
import org.jetbrains.exposed.sql.SchemaUtils
import org.jetbrains.exposed.sql.StdOutSqlLogger
import org.jetbrains.exposed.sql.addLogger
import org.jetbrains.exposed.sql.exposedLogger
import org.jetbrains.exposed.sql.transactions.transaction

fun main(args: Array<String>) {

    transaction(connectDb()) {
        SchemaUtils.create(Users, Favorites, Followers, FavoritesInUser, WordsInFavorite, EnUg, ZhUg, UgEn, UgZh, UgUg, Dictionaries)
    }


    io.ktor.server.netty.DevelopmentEngine.main(args)

//    val server = embeddedServer(Netty, 8000){
//        accountModule()
//    }

//    server.start()
}


@Location("api/v1")
class WebApiV1

@Location("api/v1.1")
class WebApiV1_1